home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Commun⁄Network / Telnet 2.5.src.ThinkC / source / UDPPB.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-09  |  1.9 KB  |  91 lines  |  [TEXT/KAHL]

  1. /* 
  2.     UDPPB.h    
  3.     C definitions of parameter block entries needed for UDP calls
  4.  
  5.     Copyright Apple Computer, Inc. 1988-89 
  6.     All rights reserved
  7.         
  8. */
  9.  
  10. #define UDPCreate        20
  11. #define UDPRead            21
  12. #define UDPBfrReturn    22
  13. #define UDPWrite        23
  14. #define UDPRelease        24
  15. #define UDPMaxMTUSize    25
  16. #define UDPCtlMax        29
  17.  
  18. typedef enum UDPEventCode {
  19.     UDPDataArrival = 1,
  20.     UDPICMPReceived,
  21.     lastUDPEvent = 65535
  22.     };
  23.  
  24. #if 0
  25. typedef pascal void (*UDPNotifyProc) (
  26.         StreamPtr udpStream, 
  27.         unsigned short eventCode, 
  28.         Ptr userDataPtr,
  29.         struct ICMPReport *icmpMsg); /* says invalid storage class with the pascal
  30.                 type in there, 7/26/90, RC */
  31.  
  32. typedef void (*UDPIOCompletionProc) (struct UDPiopb *iopb);
  33. #else
  34. typedef void *UDPNotifyProc;
  35. typedef void *UDPIOCompletionProc;
  36. #endif
  37.  
  38. typedef    unsigned short    udp_port;
  39.  
  40. typedef struct UDPCreatePB {            /* for create and release calls */
  41.     Ptr             rcvBuff;
  42.     unsigned long    rcvBuffLen;
  43.     UDPNotifyProc    notifyProc;
  44.     unsigned short    localPort;
  45.     Ptr                userDataPtr;
  46. } UDPCreatePB;
  47.     
  48. typedef struct UDPSendPB {
  49.     unsigned short    reserved;
  50.     ip_addr            remoteHost;
  51.     udp_port        remotePort;
  52.     Ptr                wdsPtr;
  53.     Boolean            checkSum;    
  54.     unsigned short    sendLength;
  55.     Ptr                userDataPtr;
  56. } UDPSendPB;
  57.     
  58. typedef struct UDPReceivePB {        /* for receive and buffer return calls */
  59.     unsigned short    timeOut;
  60.     ip_addr            remoteHost;
  61.     udp_port        remotePort;
  62.     Ptr             rcvBuff;
  63.     unsigned short    rcvBuffLen;
  64.     unsigned short    secondTimeStamp;
  65.     Ptr                 userDataPtr;
  66. } UDPReceivePB;
  67.  
  68. typedef struct UDPMTUPB {
  69.     unsigned short     mtuSize;
  70.     ip_addr            remoteHost;
  71.     Ptr                userDataPtr;
  72. } UDPMTUPB;
  73.  
  74. typedef struct UDPiopb {
  75.     char                 fill12[12];
  76.     UDPIOCompletionProc    ioCompletion;
  77.     short                 ioResult;
  78.     char                 *ioNamePtr;        
  79.     short                 ioVRefNum;        
  80.     short                ioCRefNum;            
  81.     short                 csCode;
  82.     StreamPtr             udpStream;                
  83.     union {
  84.         struct UDPCreatePB    create;
  85.         struct UDPSendPB    send;
  86.         struct UDPReceivePB    receive;
  87.         struct UDPMTUPB        mtu;
  88.     } csParam;
  89. } UDPiopb;
  90.     
  91.